<script setup>
import { io } from "socket.io-client";
import { ref,onMounted } from "vue" 



const socket = io("http://localhost:3000")

socket.on("hello",(msg)=>{
    console.log("hello",msg);
    
})

const send = ()=>{
    socket.emit('msg',"hello")
    alert(3)
}

socket.on("msg",(msg)=>{
    console.log(msg);
    
})

socket.on('connect', function(){console.log('connect')});
socket.on('event', function(data){console.log(data)});
socket.on('disconnect', function(){console.log('disconnect')});
socket.on('fromServer', function(e){console.log(e)});

onMounted(() => {
  socket.connect()  
})

</script>

<template>
    <div>
<button @click="send">send</button>
    </div>
</template>
